home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_15_aet_finale.cog < prev    next >
Text File  |  1999-11-15  |  19KB  |  644 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 15_AET_Finale.cog
  4. #
  5. # Indy, Sophia & Volodnikov stroll off into a sunrise
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12.  
  13. symbols
  14.  
  15. # .................................. MESSAGES ..................................
  16.  
  17.     message        startup
  18.     message        entered
  19.     message        crossed
  20.     message        callback
  21.     
  22. # .................................. KEYFRAMES .................................
  23.     
  24.     keyframe    in_handsONhips=0in_stand4.key            local
  25.     keyframe    in_handsTOhips=0in_stand1_bd_4.key           local
  26.     keyframe    in_rtarmup=0in_armsout_1_1.key            local # 60x
  27.     keyframe    in_botharmsup=0in_armsup_1_1.key        local
  28.     keyframe    in_gesture=0in_overshoulder_4_1.key        local
  29.     keyframe    in_pullup=0in_pulledup_1_1.key            local
  30.  
  31.     keyframe    so_sideTOhips=0so_stand2_bd_1.key        local
  32.     keyframe    so_hipsTOside=0so_stand1_bd_2.key        local
  33.     keyframe    so_handsONhips=0so_stand1.key            local
  34.     keyframe    so_pullup=0so_pulledup_2_2.key            local        
  35.     
  36.     keyframe    vo_armsATback=vo_stand2_arms_back.key    local
  37.     keyframe    vo_sideTOback=vo_stand3_bd_2.key        local
  38.     keyframe    vo_backTOside=vo_stand2_bd_3.key        local # 21x
  39.     keyframe    vo_cleanglasses=0vo_glasses_2_2.key        local # marked x61&x180/cb16    
  40.     keyframe    vo_leftup3=0vo_leftup_3_3.key            local
  41.     keyframe    vo_bothup=0vo_bothup_3_3.key            local # 52x
  42.     keyframe    vo_pullup=0vo_pullup_3_3.key            local
  43.     
  44.     keyframe    invo_pullup=0invo_pullup.key            local
  45.     
  46. # .................................. MODELS ....................................
  47.         
  48.     model        mod_in_barehead=head_in_goodhair.3do    local
  49.     model        mod_in_handhat=hand_in_hat.3do             local
  50.  
  51.     model          mod_vo_head=head_vo_noglasses.3do        local
  52.     model          mod_vo_glasses=hand_vo_glasses.3do        local
  53.             
  54. # .................................. SOUNDS ....................................
  55.  
  56.     sound        in_wellreds=Inxj067.wav                    local
  57.     sound        vo_findgod=At06v01.wav                    local
  58.     sound        in_hopenot=At06j02.wav                    local
  59.     sound        vo_relief=At06v03.wav                    local
  60.     sound        so_expectwin=At06s04.wav                local
  61.     sound        vo_struggle=At06v05.wav                    local
  62.     sound        in_vodka=At06j06.wav                    local
  63.     sound        mus_finale=mus_aet_finalcutscene.wav    local
  64.     sound        mus_finaleB=mus_aet_finalcutscene_B.wav    local
  65.  
  66. # ............................... ACTOR THINGS .................................
  67.  
  68.     thing        player                                    local
  69.     thing        indy                                    linkid=0
  70.     thing        sophia                                    nolink
  71.     thing        volod
  72.     thing        in_vo                                    
  73. # .............................. OBJECT THINGS .................................
  74.  
  75.     thing        fadeplate                                nolink
  76.     thing        logo                                    nolink
  77.     thing        ruin_1                                    nolink
  78.  
  79. # .............................. CAMERA THINGS .................................
  80.  
  81.     thing        cam_1                                    nolink
  82.     thing        cam_2                                    nolink
  83.     thing        cam_3                                    nolink
  84.     thing        cam_4                                    nolink
  85.     thing        cam_5                                    nolink
  86.     thing        cam_6                                    nolink
  87.     thing        cam_7                                    nolink
  88.  
  89.     thing        ct_1                                    nolink
  90.     thing        ct_2                                    nolink
  91.     thing        ct_3                                     nolink
  92.     thing        ct_4                                    nolink
  93.     thing        ct_5                                    nolink
  94.     thing        ct_6                                    nolink
  95.     thing        ct_7                                    nolink
  96.  
  97. # .............................. TARGET THINGS .................................
  98.  
  99.     thing        in_mk_1                                    nolink
  100.     thing        in_mk_2                                    nolink
  101.     thing        in_mk_3                                    nolink
  102.     thing        in_mk_4                                    nolink
  103.     thing        in_mk_5                                    nolink
  104.     thing        in_mk_6                                    nolink
  105.  
  106.     thing        har_in_mk_lk                            nolink
  107.     thing        har_vo_mk_lk                            nolink
  108.  
  109.     thing        so_mk_1                                    nolink
  110.     thing        so_mk_2                                    nolink
  111.     thing        so_mk_3                                    nolink
  112.     thing        so_mk_4                                    nolink
  113.     thing        so_mk_5                                    nolink
  114.     thing        so_mk_6                                    nolink
  115.  
  116.     thing        vo_mk_1                                    nolink
  117.     thing        vo_mk_2                                    nolink
  118.     thing        vo_mk_3                                    nolink
  119.     thing        vo_mk_4                                    nolink
  120.  
  121. # ............................... VAR THINGS ...................................
  122.  
  123.     thing        indycamtarget                            local # created on fly
  124.     thing        sender                                    local
  125.  
  126. # ........................ OTHER ENGINE REFERENCES .............................
  127.             
  128.     sector        startsector_1
  129.     sector        startsector_2
  130.     sector        targetsector                            local # var
  131.     
  132.     surface        startface
  133.  
  134.     template    ghost_tpl=ghost                            local
  135.     
  136. # ............................... VARIABLES ....................................
  137.     
  138.     vector        v_modvec                                local
  139.     vector        v_targetpos                                local
  140.     
  141.     flex        f_XDist                                    local
  142.     flex        f_YDist                                    local
  143.     flex        f_ZDist                                    local
  144.  
  145.     flex        in_rotrate                                local
  146.     flex        so_rotrate                                local
  147.     flex        vo_rotrate                                local
  148.  
  149.     flex        in_headrate                                local
  150.     flex        so_headrate                                local
  151.     flex        vo_headrate                                local
  152.  
  153.     int            cutSceneState=0                            local # overall state var
  154.  
  155.     int            in_colltype                                local
  156.     int            so_colltype                                local
  157.     int            vo_colltype                                local
  158.     int            iv_colltype                                local
  159.     
  160.     int            in_keytrack1                            local
  161.     int            in_keytrack2                            local
  162.     int            so_keytrack1                            local
  163.     int            vo_keytrack1                            local
  164.  
  165.     int            in_swapitem1                            local
  166.     int            in_swapitem2                            local
  167.     int            in_swapitem3                            local
  168.  
  169.     int            vo_swapitem1                            local
  170.     int            vo_swapitem2                            local
  171.     int            swapevent=0                                local
  172.             
  173.     int            cursound                                local
  174.     int            curcam                                    local
  175.     int            finale                                    local
  176.     int            finaleB                                    local
  177.  
  178. end
  179.  
  180. # ==============================================================================
  181.  
  182. code
  183.  
  184. # ..............................................................................
  185.  
  186. startup:
  187.  
  188.     # Pointer to Player...
  189.     player = GetLocalPlayerThing();
  190.  
  191.     # Prep actors...
  192.     curcam = GetCurrentCamera();
  193.     SetThingFlags(indy, 0x80000);
  194.     SetThingFlags(sophia, 0x80000);
  195.     SetThingFlags(volod, 0x80000);
  196.     AISetCutSceneMode(indy);
  197.     AISetCutSceneMode(sophia);
  198.     AISetCutSceneMode(volod);
  199.     in_rotrate = GetThingMaxRotVel(indy);
  200.     in_headrate = GetThingMaxHeadVel(indy);
  201.     in_colltype = GetCollideType(indy);
  202.     so_rotrate = GetThingMaxRotVel(sophia);
  203.     so_headrate = GetThingMaxHeadVel(sophia);
  204.     so_colltype = GetCollideType(sophia);
  205.     vo_rotrate = GetThingMaxRotVel(volod);
  206.     vo_headrate = GetThingMaxHeadVel(volod);
  207.     vo_colltype = GetCollideType(volod);
  208.     iv_colltype = GetCollideType(in_vo);
  209.  
  210.  
  211.     SetCollideType(in_vo, 0);
  212.     SetThingFlags(in_vo, 0x80000);
  213.     return;
  214.  
  215. # ..............................................................................
  216.  
  217. entered:
  218.  
  219.     sender = GetSenderRef();
  220.     if (sender != startsector_1 && sender != startsector_2 || cutSceneState != 0)
  221.     {
  222.         return;
  223.     }
  224.  
  225.     cutSceneState = 1;
  226.  
  227.     # Ready Sophia...
  228.     ClearThingFlags(sophia, 0x80000);
  229.     AISetMoveSpeed(sophia, 1.0);
  230.     AISetLookThing(sophia, so_mk_1);
  231.     AISetMoveThing(sophia, so_mk_1, 0);
  232.     AIWaitForStop(sophia);
  233.     AIEnableBodyTracking(sophia, player);
  234.  
  235.     # Prep title to prevent visual pops...
  236.     ClearThingFlags(fadeplate, 0x80000);
  237.     SetThingAlpha(fadeplate, 0.0);
  238.     SetThingFlags(fadeplate, 0x80000);
  239.     ClearThingFlags(logo, 0x80000);
  240.     SetThingAlpha(logo, 0.0);
  241.     SetThingFlags(logo, 0x80000);
  242.  
  243.     finale = PlaySoundLocal(mus_finale, 0.0, 0.0, 0x01, 0);
  244.     finaleB = PlaySoundLocal(mus_finaleB, 0.0, 0.0, 0x01, 0);
  245.  
  246.     return;
  247.  
  248. # ..............................................................................
  249.  
  250. crossed:
  251.  
  252.     if (GetSenderRef() != startface || cutSceneState > 1)
  253.     {
  254.         return;
  255.     }
  256.  
  257.     # Prep...
  258.     SetActorFlags(player, 0x200000);
  259.     StartCutscene(1);
  260.     curcam = GetCurrentCamera();
  261.     cutSceneState = 2; # do scene once only
  262.     ClearThingFlags(volod, 0x80000);
  263.     ClearThingFlags(indy, 0x80000); # summon actor
  264.     SetThingFlags(indy, 0x10); # but keep him invisible
  265.     TeleportThing(indy, in_mk_1); 
  266.     SetThingMaxHeadVel(indy, 100.0);
  267.     SetThingMaxRotVel(indy, 200.0);
  268.     SetThingMaxHeadVel(sophia, 100.0);
  269.     SetThingMaxRotVel(sophia, 200.0);
  270.     SetCameraLookInterp(2, 0);
  271.     SetCameraPosInterp(2, 0);
  272.     
  273.     # Establish a target near Indy...
  274.     v_targetpos =
  275.         VectorAdd(VectorTransformToOrient(player, '0.01 0.07 0.045'), GetThingPos(player));    
  276.     targetsector = FindNewSectorFromThing(player, v_targetpos);
  277.     indycamtarget = 
  278.         CreateThingAtPos(ghost_tpl, targetsector, v_targetpos, '0 0 0');
  279.     CaptureThing(indycamtarget);
  280.     AttachThingToThing(indycamtarget, player);
  281.  
  282.     SetFog(0, '0 0 0', 0, 0);
  283.  
  284.     # Cut to Indy standing up...
  285.     SetCameraFocus(2, cam_1);
  286.     SetCameraSecondaryFocus(2, indycamtarget);
  287.     SetCurrentCamera(2);
  288.     SetCameraFOV(30, 0, 0.0);
  289.     Sleep(0.01);
  290.     SetCameraFOV(55, 1, 2.0);
  291.  
  292.     # Play music...
  293.     StopSound(finale, 0.0);
  294.     finale = PlaySoundLocal(mus_finale, 1.0, 0.0, 0x0, 0);
  295.  
  296.     # Wait until he's all the way up...
  297.     Sleep(0.8);
  298.  
  299.     # Switch actor Indy for player...
  300.     StopThing(player); # right now
  301.     PlayMode(player, 1, 0); # get him into a nice stand
  302.     CopyPlayerHolsters(player, indy); # match props    
  303.     Sleep(0.01);
  304.     TeleportThing(indy, player);
  305.     SetThingFlags(player, 0x80000); # hide player
  306.     ClearThingFlags(indy, 0x10); # now show actor
  307.     AIEnableBodyTracking(sophia, indy);
  308.  
  309.     # Walk Indy forward...
  310.     AttachThingToThing(indycamtarget, indy);
  311.     AISetMoveSpeed(indy, 1.0);
  312.     AIEnableHeadTracking(indy, sophia);
  313.     AISetLookThingEyeLevel(indy, in_mk_2);
  314.     AISetMoveThing(indy, in_mk_1, 0);
  315.     Sleep(1.0);
  316.     SetThingMaxHeadVel(sophia, 200.0);
  317.     SetThingMaxRotVel(sophia, 400.0);
  318.     AISetLookThing(sophia, volod);
  319.     AIEnableBodyTracking(sophia, volod);    
  320.     AIEnableHeadTracking(indy, volod);
  321.     Sleep(0.3); # was 0.5
  322.     AIDisableHeadTracking(indy);
  323.     AIEnableBodyTracking(indy, volod);
  324.     AIWaitForStop(indy);
  325.     in_keytrack1 = PlayKey(indy, in_handsONhips, 2, 0x10, 0);
  326.  
  327.     # Prep Dr. V...
  328.     AttachThingToThing(ct_2, volod);
  329.     AISetMoveSpeed(volod, 0.9);
  330.     AISetLookThing(volod, indy);
  331.     AIEnableBodyTracking(sophia, volod);
  332.  
  333.     # Indy: "Well well, reds again."
  334.     cursound = PlayVoice(indy, in_wellreds, 1.0, 0);
  335.     PlayKey(indy, in_handsTOhips, 4, 0x12, 1);
  336.     WaitForSound(cursound);
  337.  
  338.     # Dr. V leads camera back to pit...
  339.     AISetMoveThing(volod, vo_mk_1, 0);
  340.  
  341.     # Cut to Volodnikov approaching...
  342.     SetCameraFocus(2, cam_2);
  343.     SetCameraSecondaryFocus(2, ct_2);
  344.     SetCameraFOV(25, 0, 0.0); # was 30
  345.     DestroyThing(indycamtarget);
  346.     Sleep(2.0); # walks go quicker in engine
  347.  
  348.     # Dolly back...
  349.     SetCameraInterpSpeed(2, 2.0);
  350.     SetCameraLookInterp(2, 1);
  351.     SetCameraPosInterp(2, 1);
  352.     Sleep(0.01);
  353.     AIEnableHeadTracking(volod, indy);
  354.     SetCameraFocus(2, cam_3);
  355.     SetCameraSecondaryFocus(2, ct_3);
  356.     SetCameraFOV(79, 1, 2.0);
  357.     AIWaitForStop(volod);
  358.  
  359.     # Volodnikov: "Did you find God, Dr. Jones?"
  360.     cursound = PlayVoice(volod, vo_findgod, 1.0, 0);
  361.     PLayKey(volod, vo_bothup, 4, 0x12, 0);
  362.     WaitForSound(cursound);
  363.  
  364.     # Indy: "I hope not.  Whoever...not very forgiving."
  365.     cursound = PlayVoice(indy, in_hopenot, 1.0, 0);
  366.     Sleep(1.5);
  367.     StopKey(indy, in_keytrack1, 0.0);
  368.     AIDisableBodyTracking(indy);
  369.     AISetLookThingEyeLevel(indy, in_mk_3);
  370.     PlayKey(indy, in_gesture, 4, 0x12, 0);
  371.     Sleep(1.0);
  372.     AISetLookThingEyeLevel(indy, volod);
  373.     vo_keytrack1 = PlayKey(volod, vo_armsATback, 2, 0x10, 0);
  374.     PlayKey(volod, vo_sideTOback, 4, 0x12, 0);
  375.     WaitForSound(cursound);
  376.  
  377.     # Volodnikov: "That's a relief...socialist theory disavows supernatural powers."
  378.     cursound = PlayVoice(volod, vo_relief, 1.0, 0);
  379.     swapevent = 1; # see callback
  380.     PlayKey(volod, vo_cleanglasses, 4, 0x12, 0);
  381.     Sleep(2.0);
  382.     AIDisableBodyTracking(sophia);
  383.     Sleep(0.5);
  384.     AIEnableHeadTracking(sophia, indy);
  385.     AIEnableHeadTracking(indy, sophia);
  386.     Sleep(1.0);
  387.     swapevent = 2; # see callback
  388.     Sleep(0.5);
  389.     AIEnableHeadTracking(sophia, volod);
  390.     AIEnableHeadTracking(indy, volod);
  391.     AISetMoveThing(sophia, so_mk_2, 0);
  392.     WaitForSound(cursound);
  393.     AIWaitForStop(sophia);
  394.  
  395.     # Sophia: "And you expect to win the cold war?"
  396.     cursound = PlayVoice(sophia, so_expectwin, 1.0, 0);
  397.     so_keytrack1 = PlayKey(sophia, so_handsONhips, 2, 0x10, 0);
  398.     PlayKey(sophia, so_sideTOhips, 4, 0x12, 0);
  399.     Sleep(0.5);
  400.     AIEnableHeadTracking(volod, sophia);
  401.     WaitForSound(cursound);
  402.  
  403.     # Volodnikov: "I expect a long struggle."
  404.     cursound = PlayVoice(volod, vo_struggle, 1.0, 0);
  405.     StopKey(volod, vo_keytrack1, 0.0);
  406.     PlayKey(volod, vo_backTOside, 4, 0x12, 1);
  407.     PlayKey(volod, vo_leftup3, 4, 0x12, 0);
  408.     StopKey(sophia, so_keytrack1, 0.0);
  409.     PlayKey(sophia, so_hipsTOside, 4, 0x12, 1);
  410.     WaitForSound(cursound);
  411.  
  412.     # Prep Indy pullup...
  413.     SetThingFlags(in_vo, 0x10);
  414.     ClearThingFlags(in_vo, 0x80000);
  415.  
  416.     # Volod helps Sophia out of pit...
  417.     SetThingMaxRotVel(volod, 120.0);
  418.     AISetLookThing(volod, sophia);
  419.     AIDisableHeadTracking(sophia);
  420.     AISetLookThingEyeLevel(sophia, so_mk_4); # was volod
  421.     Sleep(0.3);
  422.     PlayKey(volod, vo_pullup, 4, 0x12, 0);
  423.     PlayKey(sophia, so_pullup, 4, 0x12, 1);
  424.     TeleportThing(sophia, so_mk_3);
  425.      Sleep(0.1);
  426.     AISetLookThingEyeLevel(sophia, so_mk_4);
  427.     AIDIsableHeadTracking(volod);
  428.     SetThingMaxRotVel(volod, vo_rotrate);
  429.     AISetMoveThing(sophia, so_mk_4, 0);
  430.     Sleep(0.5);
  431.     
  432.     # Volodnikov helps Indy out of pit...
  433.     AIEnableBodyTracking(volod, indy);
  434.     AISetMoveThing(volod, vo_mk_2, 0);
  435.     AISetLookThing(volod, har_vo_mk_lk);
  436.     SetCameraInterpSpeed(2, 2.0);
  437.     Sleep(0.01);
  438.     SetCameraFocus(2, cam_4);
  439.     SetCameraSecondaryFocus(2, ct_4);
  440.     SetCameraFOV(60, 1, 2.0);
  441.  
  442.     AIDisableHeadTracking(indy);
  443.     AISetLookThing(indy, har_in_mk_lk);
  444.       AISetMoveThing(indy, in_mk_2, 0);
  445.      Sleep(0.25);
  446.     
  447.     # Here begin the changes Harley made...
  448.     
  449.     SetCameraInterpSpeed(2, 1.7);
  450.     Sleep(0.01);
  451.     SetCameraSecondaryFocus(2, ct_7);
  452.     Sleep(1.0);
  453.  
  454.     # Show Indy volodnikov thing, make other guys invisible,  
  455.     ClearThingFlags(in_vo, 0x10);
  456.     SetThingFlags(indy, 0x80000);
  457.     SetThingFlags(volod, 0x80000);
  458.     
  459.     # and play pullup key...
  460.     PlayKey(in_vo, invo_pullup, 4, 0x12, 1);
  461.     
  462.     # Hide Indy volodnikov thing, make other guys visible...  
  463.     SetThingFlags(in_vo, 0x80000);
  464.     ClearThingFlags(indy, 0x80000);
  465.     ClearThingFlags(volod, 0x80000);
  466.  
  467.     # Here end the changes Harley Made...
  468.  
  469.     # Cut to Indy close-up...
  470.     SetCameraLookInterp(2, 0);
  471.     SetCameraPosInterp(2, 0);
  472.     SetCameraFocus(2, cam_5);
  473.     SetCameraSecondaryFocus(2, ct_5);
  474.     SetCameraFOV(38, 0, 0.0);
  475.     SetThingFlags(volod, 0x10);
  476.     TeleportThing(indy, in_mk_3);
  477.     StopKey(indy, in_keytrack1, 0.0);
  478.     AISetLookThingEyeLevel(indy, in_mk_6);
  479.     Sleep(1.0);
  480.  
  481.     # Clean up looks...
  482.     AIDisableHeadTracking(indy);
  483.     AIDisableBodyTracking(indy);
  484.     AIDisableHeadTracking(sophia);
  485.     AIDisableBodyTracking(sophia);
  486.     AISetLookThing(sophia, indy);
  487.     AIDisableHeadTracking(volod);
  488.     AIDisableBodyTracking(volod);
  489.     StopKey(volod, vo_keytrack1, 0.0);
  490.  
  491.     # Indy: "Listen, Gennadi...socialist vodka...I'm thirsty."
  492.     cursound = PlayVoice(indy, in_vodka, 1.0, 0); # 5.4 sec
  493.  
  494.     PlayKey(indy, in_rtarmup, 4, 0x12, 1); # 2 sec
  495.     Sleep(2.2);
  496.     in_keytrack2 = PlayKey(indy, in_botharmsup, 4, 0x12, 0);
  497.     
  498.     # Stop first music cue and begin last one.
  499.     StopSound(finale, 1.0);
  500.     StopSound(finaleB, 0.0);
  501.     finaleB = PlaySoundLocal(mus_finaleB, 1.0, 0.0, 0x0, 0);
  502.         
  503.     Sleep(1.5);
  504.     
  505.     StopKey(indy, in_keytrack2, 0.5);
  506.     WaitForSound(cursound);
  507.  
  508.     # Start Indy exit...
  509.     AttachThingToThing(ct_6, indy);
  510.     AISetMoveSpeed(indy, 0.85);
  511.     AISetLookThingEyeLevel(indy, in_mk_4);
  512.     AISetMoveThing(indy, in_mk_4, 0);
  513.     Sleep(1.0);
  514.  
  515.     # All three hike out of the dig site...
  516.     AISetLookThingEyeLevel(sophia, so_mk_5);
  517.     AISetMoveThing(sophia, so_mk_5, 0);
  518.     AISetMoveSpeed(sophia, 1.2);
  519.     ClearThingFlags(volod, 0x10);
  520.     AISetMoveSpeed(volod, 1.15);
  521.     AISetLookThingEyeLevel(volod, vo_mk_3);
  522.     AISetMoveThing(volod, vo_mk_3, 0);
  523.     
  524.     # Cut to long shot of the trio...
  525.     SetCameraFocus(2, cam_6);
  526.     SetCameraSecondaryFocus(2, ct_6);
  527.     SetCameraFOV(90, 0, 0.0);
  528.     SetCameraInterpSpeed(2, 12.0);
  529.     SetCameraPosInterp(2, 1);
  530.     Sleep(0.01);
  531.     SetCameraFocus(2, cam_7);
  532.     SetCameraFOV(45, 1, 12.0);
  533.     Sleep(1.5);
  534.  
  535.     # Redirect Indy...
  536.     AISetLookThingEyeLevel(indy, in_mk_5);
  537.     AISetMoveThing(indy, in_mk_5, 0);
  538.     Sleep(0.5);
  539.  
  540.     # Redirect Sophia and Volodnikov off into a sunrise...
  541.     AISetLookThingEyeLevel(sophia, so_mk_6);
  542.     AISetMoveThing(sophia, so_mk_6, 0);
  543.     AISetLookThingEyeLevel(volod, vo_mk_4);
  544.     AISetMoveThing(volod, vo_mk_4, 0);
  545.     Sleep(1.0);
  546.     AISetMoveSpeed(sophia, 1.0);
  547.     AISetMoveSpeed(volod, 1.0);
  548.     Sleep(1.5);
  549.     AIEnableHeadtracking(volod, indy);
  550.     AIEnableHeadTracking(indy, volod);
  551.     Sleep(2.0);
  552.     AISetMoveSpeed(indy, 1.0);
  553.     AIEnableHeadTracking(volod, vo_mk_4);
  554.     AIEnableHeadTracking(sophia, indy);
  555.     AIEnableHeadTracking(indy, sophia);
  556.     Sleep(2.0);
  557.     AIEnableHeadTracking(indy, in_mk_5);
  558.     AIEnableHeadTracking(sophia, so_mk_6);
  559.     Sleep(3.5);
  560.  
  561.     # Settle on nice frame...
  562.     DetachThing(ct_6);
  563.     Sleep(3.0);
  564.  
  565.     # Fade out vista and play main title...
  566.     ClearThingFlags(fadeplate, 0x80000);
  567.     ThingFadeAnim(fadeplate, 0.0, 1.0, 1.0, 0);
  568.     ThingFadeAnim(ruin_1, 1.0, 0.0, 1.3, 0);
  569.     Sleep(1.0);
  570.     ClearThingFlags(logo, 0x80000);
  571.     ThingFadeAnim(logo, 0.0, 1.0, 0.3, 0);
  572.     Sleep(8.5);
  573.     ThingFadeAnim(logo, 1.0, 0.0, 1.0, 0);
  574.     Sleep(3.0);
  575.     
  576.     # Clean up & restore control (TEMP!!!)...
  577.     DestroyThing(indy);
  578.     DestroyThing(sophia);
  579.     DestroyThing(volod);
  580.     ## ClearThingFlags(player, 0x80000);
  581.     SetCameraLookInterp(2, 0);
  582.     SetCameraPosInterp(2, 0);
  583.     ## SetCurrentCamera(curcam);
  584.     ## ResetCameraFOV(0, 0.0);
  585.     ## ClearActorFlags(player, 0x200000);
  586.     
  587.     EndCutScene();
  588.     SetSwimmingInventory(player, 1);
  589.     JonesEndLevel();
  590.  
  591.     return;
  592.  
  593. # ..............................................................................
  594.  
  595. callback:
  596.  
  597.     if (swapevent == 1)
  598.     {        
  599.         # Volodnikov removes his glasses...
  600.         vo_swapitem1 = SetThingMesh(volod, 2, mod_vo_head, 0); # no glasses head
  601.         vo_swapitem2 = SetThingMesh(volod, 8, mod_vo_glasses, 0); # hand with glasses
  602.  
  603.         # RT: Set up alternate heads
  604.         SetThingVoiceHeads(volod, "vohead", "head_vo_noglasses.3do", "head_vo_nospecs_asound.3do", "head_vo_nospecs_amsound.3do", "head_vo_nospecs_osound.3do");
  605.         
  606.         swapevent = 0; # reset
  607.     }
  608.     
  609.     if (swapevent == 2)
  610.     {
  611.         # Volodnikov replaces his glasses...
  612.         RestoreThingMesh(volod, vo_swapitem1);
  613.         RestoreThingMesh(volod, vo_swapitem2);
  614.         
  615.         # RT: Restore default heads
  616.         SetThingVoiceHeads(volod, "vohead", "head_vo_msound.3do", "head_vo_asound.3do", "head_vo_amsound.3do", "head_vo_osound.3do");
  617.         
  618.         swapevent = 0; # reset
  619.     }
  620.  
  621.     if (swapevent == 3)
  622.     {
  623.         in_swapitem1 = SetThingMesh(indy, 8, mod_in_barehead, 0);
  624.         in_swapitem2 = SetThingMesh(indy, 9, mod_in_barehead, 1);
  625.         in_swapitem3 = SetThingMesh(indy, 15, mod_in_handhat, 0);
  626.  
  627.         # RT: Set up no-hat heads...
  628.         SetThingVoiceHeads(indy, "inhead", "head_in_goodhair.3do", "head_in_asound_gh.3do", "head_in_amsound_gh.3do", "head_in_osound_gh.3do");
  629.     }
  630.  
  631.     if (swapevent == 4)
  632.     {
  633.         RestoreThingMesh(indy, in_swapitem1);
  634.         RestoreThingMesh(indy, in_swapitem2);
  635.         RestoreThingMesh(indy, in_swapitem3);
  636.  
  637.         # RT: Restore default heads...
  638.         SetThingVoiceHeads(indy, "inhead", "", "head_in_asound.3do", "head_in_amsound.3do", "head_in_osound.3do");
  639.     }
  640.     
  641.     return;
  642.  
  643. end
  644.